package com.wd.demo1.config;

import com.wd.demo1.persistent.DemoPersistent;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 * @author Administrator
 * @date 2025-11-02 15:21
 */
public class DemoConfigUI {

	private JPanel rootPanel;
	private JTextField configPathTextField;
	DemoPersistent persistent = DemoPersistent.getInstance();

	public JComponent createComponent() {
		return rootPanel;
	}

	public void apply() {
		persistent.setPath(configPathTextField.getText());
	}

	public void reset() {
		configPathTextField.setText(persistent.getPath());
	}

	public boolean isModified() {
		return !configPathTextField.getText().equals(persistent.getPath());
	}

}
